Skip to content

Feat/issue 1179 roadmap progress - #1199

Merged
komalharshita merged 7 commits into
komalharshita:mainfrom
desireddymohithreddy0925:feat/issue-1179-roadmap-progress
Jul 19, 2026
Merged

Feat/issue 1179 roadmap progress#1199
komalharshita merged 7 commits into
komalharshita:mainfrom
desireddymohithreddy0925:feat/issue-1179-roadmap-progress

Conversation

@desireddymohithreddy0925

Copy link
Copy Markdown

Summary

This PR resolves #1179 by adding full backend database persistence for the Roadmap Progress checkboxes on the project detail page. Previously, progress was solely stored in localStorage, meaning users lost their progress when switching between mobile devices and laptops. This PR introduces a hybrid system: logged-in users get persistent cross-device database synchronization, while unregistered visitors seamlessly fall back to using localStorage.

Because this feature relies on the User and Project SQLAlchemy models, this branch incorporates the database migration commits from the Admin Dashboard feature (#1178).

Related Issue

Closes #1179

Type of Change

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed

File Change made
src/models.py Introduced a ProjectProgress model to link Users and Projects and track a JSON array of completed_steps boolean states. Added the reverse progress relationship on Users.
src/routes/main_routes.py Implemented GET /api/project/<id>/progress to retrieve states, and POST /api/project/<id>/progress to upsert checking states for logged-in users.
src/templates/project.html Injected a USER_LOGGED_IN javascript boolean.
src/static/script.js Updated updateRoadmapProgress to use the Fetch API. On page load, the script now asynchronously asks the backend for the roadmap state. Clicking a checkbox silently fires a POST payload to update the database. Falls back to localStorage when USER_LOGGED_IN is false.
tests/test_basic.py Removed a rogue test that broke CI and added new tests enforcing 401 Unauthorized responses for unauthenticated roadmap API usage.

How to Test This PR

  1. Checkout the branch: git checkout feat/issue-1179-roadmap-progress
  2. Run pip install -r requirements.txt.
  3. If you haven't yet, run python src/seed_db.py to seed your local SQLite database.
  4. Boot the server python src/app.py.
  5. Visit the homepage, do not log in, open a project roadmap, and check a few boxes. Reload the page to ensure the localStorage fallback persists your checked boxes.
  6. Log in with GitHub. Open a project roadmap, check a few boxes.
  7. Open a brand new private/incognito window, log in again, and navigate to the same project. Your checked boxes should be fully synchronized from the backend database!

Test Results

============================= test session starts ==============================
platform darwin -- Python 3.9.6, pytest-8.2.2, pluggy-1.6.0
rootdir: /Users/desireddymohithreddy/GSSOC2026DevPath/DevPathMRD
collected 88 items

tests/test_basic.py .................................................... [ 59%]
....................................                                     [100%]

======================== 88 passed, 1 warning in 1.13s =========================

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run pytest tests/test_basic.py and all tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

DESIREDDY MOHITH REDDY added 5 commits June 26, 2026 16:52
…y) (komalharshita#1176)

- Added Flask-SQLAlchemy to requirements
- Created Project db.Model with db.JSON support
- Wrote seed_db.py script to migrate JSON to SQLite
- Refactored load_all_projects to query SQLite db
- Updated test_basic.py to use temporary in-memory sqlite db
)

- Integrated Authlib for GitHub OAuth login flow
- Created User SQLAlchemy database model
- Created auth routes (/login, /authorize, /logout)
- Developed protected /profile dashboard template
- Hooked session auth state into main navigation
- Added automated routing redirection tests
…1178)

- Created secure /admin routes protected by is_admin check
- Added is_admin column to User database model
- Built dashboard.html with paginated project listings
- Built form.html for creating and updating projects natively into SQLite backend
- Restructured index.html navigation dynamically for admins
- Added test_admin_forbidden_for_anonymous, test_admin_forbidden_for_normal_user, and test_admin_crud
- Added ProjectProgress SQLAlchemy model to track roadmap state
- Created GET and POST /api/project/<id>/progress routes
- Injected USER_LOGGED_IN boolean into project.html payload
- Refactored script.js roadmap checkboxes to use hybrid Fetch API and localStorage logic
- Added unauthenticated endpoint tests to test_basic.py
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! The roadmap progress persistence feature is valuable, but I have a few requests before this PR can be merged.

  • Please resolve the current merge conflicts with the latest main branch.
  • The PR currently includes data/devpath.db. Committed database files generally shouldn't be part of the repository unless absolutely necessary. Please remove it and use migrations/seed data if schema changes are required.
  • Since this PR touches multiple areas (models, routes, templates, scripts, tests, and admin functionality), please clarify which changes are essential for roadmap progress persistence and which are supporting changes.
  • Please include testing evidence for both authenticated users (database persistence) and guest users (localStorage fallback), as well as synchronization behavior after login.

Once these items are addressed, I'd be happy to review it again.

@komalharshita komalharshita added the need review Further information is requested label Jul 18, 2026
DESIREDDY MOHITH REDDY added 2 commits July 18, 2026 21:02
- Resolved conflicts in models, routes, templates, and scripts
- Removed data/devpath.db from git tracking as it shouldn't be version controlled
- Synchronized tests to work with both Authlib and updated pytest
@desireddymohithreddy0925

Copy link
Copy Markdown
Author

@komalharshita done mam

@komalharshita
komalharshita merged commit a6a8a82 into komalharshita:main Jul 19, 2026
5 of 6 checks passed
@komalharshita

Copy link
Copy Markdown
Owner

Thank you for your contribution to DevPath and for taking the time to improve our project!

Great work, and I'm happy to approve this PR. Keep contributing! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Interactive Roadmap Progress Tracking API

2 participants